<template>
  <div>
    <!-- 三级联动组件已经为全局组件了，需要再进行注册了 -->
    <TypeNav></TypeNav>
    <Carousel></Carousel>
    <Recommend></Recommend>
    <Rank></Rank>
    <Like></Like>
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor"/>
    <Brand></Brand>
  </div>
</template>

<script>
// 引入其他组件
import Carousel from "./ListContainer/Carousel.vue";
import Recommend from "./Today-Recommend1/Recommend.vue";
import Rank from "./Rank/Rank.vue";
import Like from "./Like/Like.vue";
import Floor from "./Floor/index.vue";
import Brand from "./Brand/Brand.vue";
import {mapState} from "vuex"
export default {
  name: "Home",
  components: {
    Carousel,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand,
  },
  mounted() {
    this.$store.dispatch("getFloorList");
  },
  computed: {
    ...mapState({
      floorList: (state) => {
        return state.home.floorList;
      },
    }),
  },
};
</script>

<style>
</style>